package com.rlyy.grpc.strategy.single;

import io.netty.handler.codec.http.HttpMethod;
import lombok.Data;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * 配置默认Netty和Servlet处理那些请求。
 * 不配置按默认Netty处理POST请求、Servlet处理GET请求。
 *
 * @author yuanqinglong
 * @since 2020/11/11 15:01
 */
@Data
//@Configuration
//@ConfigurationProperties(prefix = "http.method")
public class RequestProcessingConditions {

    /**
     * Servlet处理的请求 例:(GET、PUT、DELETE)
     */
    private Set<String> servletMethods = new HashSet<>(Collections.singleton(HttpMethod.GET.name()));
    /**
     * Servlet处理的请求 例:(POST)
     */
    private Set<String> nettyMethods = new HashSet<>(Collections.singleton(HttpMethod.POST.name()));
    /**
     * 自定义扩展处理的请求
     *
     * 需配置文件配置处理请求方式：
     * http:
     *   method:
     *     customize-methods:
     *     - GET
     *     - PUT
     *     - DELETE
     */
    private Set<String> customizeMethods;


}
